#include "proflepage.h"
#include "ui_proflepage.h"

ProflePage::ProflePage(QWidget *parent) :
    QWidget(parent),
    ui(new Ui::ProflePage)
{
    QPixmap p;
    ui->setupUi(this);
    Singleton* s1 = Singleton::getInstance();
    ui->NameLabel->setText(s1->name);
    ui->SurnameLabel->setText(s1->surname);
    ui->PatronymicLabel->setText(s1->patronymic);
    if (s1->role == "Admin")
    {
        ui->RoleLabel->setText("Админ");
    }
    else
    {
        ui->RoleLabel->setText("Сотрудник");
    }
    if(p.loadFromData(s1->image, "JPEG"))
    {
        ui->profileImage->setPixmap(p);
    }
}

ProflePage::~ProflePage()
{
    delete ui;
}
